import {BaseSession} from "./base";

const TYPE_ANY = -1
const TYPE_ACCELEROMETER = 1
const TYPE_ORIENTATION = 3
const TYPE_LIGHT = 5
const TYPE_TEMPERATURE = 7
const TYPE_GRAVITY = 9
const TYPE_LINEAR_ACCELERATION = 10
const TYPE_AMBIENT_TEMPERATURE = 13

// 采样频率
const SENSOR_DELAY_FASTEST = 0
const SENSOR_DELAY_GAME = 1
const SENSOR_DELAY_UI = 2
const SENSOR_DELAY_NORMAL = 3


class SensorSession extends BaseSession {

    constructor(render: HTMLElement) {
        super('Sensor', render);
    }

    onCreate(sessionId: number, futureId: number, ...argv) {
        super.onCreate(sessionId, futureId, ...argv);
    }

    onDestroy() {
        super.onDestroy();
    }

    onReceive(name: String, sessionId: number, futureId: number, ...argv) {
        switch (name) {
            case "getList":
                this.getList(sessionId, futureId, ...argv);
                return;
            case "getDefault":
                this.getDefault(sessionId, futureId, ...argv);
                return;
                ;
            case  "registerListener":
                this.registerListener(...argv);
                return;
            case "unregisterListener":
                this.unregisterListener();
            default:
                super.onReceive(name, sessionId, futureId, ...argv);
        }
    }

    private getList(sessionId: number, futureId: number, ...argv: any[]) {

    }

    private getDefault(sessionId: number, futureId: number, ...argv: any[]) {

    }

    private registerListener(...argv: any[]) {

    }

    private unregisterListener() {

    }
}

export {SensorSession}